package com.geoboard.service;

import android.util.Log;
import android.widget.Toast;

import com.android.volley.Response;
import com.geoboard.entity.Post;
import com.geoboard.fragments.MapFrag;

public class PostPostListener implements Response.Listener<Post>{

	/**** Members **************************************************/
	private String TAG = this.getClass().getSimpleName();
	private MapFrag mMapFrag;
	
	public PostPostListener (MapFrag mapFrag) {
		mMapFrag = mapFrag;
	}
	
	@Override
	public void onResponse(Post post) {
		Log.d(TAG, "successful post");
        Toast.makeText(mMapFrag.getActivity(),
        		"Posted!", Toast.LENGTH_SHORT).show();
        mMapFrag.getVisiblePosts().add(post);
        mMapFrag.displayPosts();
	}

}
